import request from '@/utils/request'

export function createApply(data) {
    return request({
        url: '/notReturned/createApply',
        method: 'post',
        data
    })
}

export function listBDormitory(query) {
    return request({
        url: '/basedata/bdormitory/list',
        method: 'get',
        params: query
    })
}

// 查询表格列表
export function getPageList(data) {
    return request({
        url: '/notReturned/pageList',
        method: 'post',
        data
    })
}

// 新建申请单
export function creatApply(data) {
    return request({
        url: '/notReturned/createApply',
        method: 'post',
        data
    })
}

// 根据学生id查询学生信息
export function getStudentById(id) {
    return request({
        url: `/basedata/bstudent/getStudentById/${id}`,
        method: 'get',
    })
}

// 查询楼栋
export function getDictType(type) {
    return request({
        url: `/sys/dict/detail/dictType/${type}`,
        method: 'get',
    })
}

// 撤销申请单
export function cancelApply(data) {
    return request({
        url: '/notReturned/cancelApply ',
        method: 'post',
        data
    })
}

// 查询待办工作流
export function findCurrUserToDoTasks(data) {
    return request({
        url: '/workflow/findCurrUserToDoTasks',
        method: 'post',
        data
    })
}

// 处理工作流
export function processWorkFlow(data) {
    return request({
        url: '/workflow/processWorkFlow',
        method: 'post',
        data
    })
}

// 查询工作流信息
export function workFlowInfo(data) {
    return request({
        url: '/workflow/workFlowInfo ',
        method: 'post',
        data
    })
}


// 查看某个申请单的处理历史
export function historyWorkFlowList(data) {
    return request({
        url: '/workflow/historyWorkFlowList',
        method: 'post',
        data
    })
}

// 查看已完成工作流列表
export function findHistoryApproval(data) {
    return request({
        url: '/notReturned/findHistoryApproval',
        method: 'post',
        data
    })
}